<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>let const</title>
	</head>
	<body>
		<script>
			let {
				title: title01,
				datas: [{
					subTitle: title02
				}]
			} = {
				title: 'E6入门',
				datas: [{
					subTitle: "27天精通"
				}]
			}
			console.log(title01, title02);

			let a = 1;
			let b = 2;
			[a, b] = [b, a];
			console.log(a, b);

			let arr = [1, 2, 3, 4];
			let arr2 = [...arr, 5, 6]; //[1, 2, 3, 4, 5, 6]
			console.log(arr2);

			function fn(...args) {
				console.log(args);
			}
			fn(1, 2);
			fn(1);
			fn(1, 2, 3, 4, 5);

			let [first, ...coll] = [1, 2, 3, 4, 5];
			console.log(first, coll);

			let user1 = {
				name: 'haoren',
				pwd: 250,
				gender: "F"
			}
			let user2={
				...user1,
				age: 14
			}
			//{name: "haoren", pwd: 250, gender: "F", age: 14}
			console.log(user2);
		</script>
	</body>
</html>
